#HTML <th>
The <th> HTML element defines a cell as the header of a group of table cells and may be used as a child of the <tr> element. The exact nature of this group is defined by the scope and headers attributes.
#Attributes
-
abbr
: A short, abbreviated description of the header cell's content provided as an alternative label to use for the header cell when referencing the cell in other contexts. Some user-agents, such as speech readers, may present this description before the content itself. -
colspan
: A non-negative integer value indicating how many columns the header cell spans or extends. The default value is1
. User agents dismiss values higher than 1000 as incorrect, defaulting such values to1
. -
headers
: A list of space-separated strings corresponding to theid
attributes of the<th>
elements that provide the headers for this header cell. -
rowspan
: A non-negative integer value indicating how many rows the header cell spans or extends. The default value is1
; if its value is set to0
, the header cell will extends to the end of the table grouping section (<thead>
,<tbody>
,<tfoot>
, even if implicitly defined), that the<th>
belongs to. Values higher than65534
are clipped at65534
. -
scope
: Defines the cells that the header (defined in the<th>
) element relates to. Possible enumerated values are:row
: the header relates to all cells of the row it belongs to;col
: the header relates to all cells of the column it belongs to;rowgroup
: the header belongs to a rowgroup and relates to all of its cells;colgroup
: the header belongs to a colgroup and relates to all of its cells.
If the
scope
attribute is not specified, or its value is notrow
,col
,rowgroup
, orcolgroup
, then browsers automatically select the set of cells to which the header cell applies.